<template>
    
<mt-header fixed v-bind:title="path" >
        <mt-button icon="back" slot="left" @click="$router.back(-1)" v-show="$route.path!='/'&&$route.path!='/msite'"></mt-button>
    <router-link to="/search" slot="right">
        <mt-button v-show="$route.path!='/search'">搜索</mt-button>
    </router-link>
</mt-header>
</template>

<script>
export default {
  name: 'HeaderTop',
  data() {
    return {
        path:"",
    }
  },methods: {
  },watch: {
      $route(){
      let path=this.$route.path
          if(path==="/classify"){
              this.path="分类"
          }if(path==="/msite"||path==="/"){
              this.path="首页"
          }if(path==="/shoppingcart"){
              this.path="购物车"
          }if(path==="/profile"){
              this.path="会员中心"
          }if(path==="/search"){
              this.path="搜索中心"
          }if(path==="/myaddress"){
              this.path="收货地址管理"
          }if(path==="/addaddress"){
              this.path="添加收货地址"
          }
      }
  }
}
</script>

<style scoped>
</style>
